package ${package.ServiceImpl};

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Arrays;
import java.util.List;

/**
* <p>
    * ${table.comment!} 服务实现类
    * </p>
*
* @author ${author}
* @since ${date}
*/
@Service
<#if kotlin>
    open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

    }
<#else>
    public class ${table.serviceImplName}  implements ${table.serviceName} {

    @Autowired
    private ${table.mapperName} dao;

    /**
    * 添加信息
    * @param entity
    * @return
    */
    @Override
    public int add(${entity} entity) {
    return dao.insert(entity);
    }

    /**
    * 编辑信息
    * @param entity
    * @return
    */
    @Override
    public int update(${entity} entity) {
    return dao.updateById(entity);
    }

    /**
    * 获取列表信息
    * @param queryWrapper
    * @return
    */
    @Override
    public List<${entity}> selectList(Wrapper<${entity}> queryWrapper) {
    return dao.selectList(queryWrapper);
    }


    /**
    * 分页获取列表信息
    * @param page
    * @param queryWrapper
    * @return
    */
    @Override
    public IPage<${entity}> selectPage(Page page, Wrapper<${entity}> queryWrapper) {
    return dao.selectMapsPage(page,queryWrapper);
    }

    /**
    * 批量删除
    * @param ids
    * @return
    */
    @Override
    public int deleteBatchIds(Integer[] ids){
    return dao.deleteBatchIds(Arrays.asList(ids));
    }
    }
</#if>


